{include file="common/Header.html"}
<body class="body-main">

<ul id="admin_sub_title">
	<li class="unsub"><a href="{'Admin/Cache/index'|url}">缓存设置</a></li>
	<li class="sub"><a href="javascript:void(0)">清除缓存</a></li>
</ul>

<div id="admin_right_b">

  <table border="0" style="width:100%" align="center" cellpadding="3" cellspacing="1" class="table_b">

	<tr align='center'>
	  <td class="title_bg">缓存说明</td>
      <td class="title_bg" width="120">缓存大小</td>
      <td width="100" class="title_bg">操作</td>
    </tr>

	<tr class="tdbg">
		<td style="padding-left:20px">模板编译缓存 (<span>修改模板后，需要清除模板缓存才能生效</span>)</td>
		<td align='center'><font color='green'>{$compile_cache} MB</font></td>
		<td align='center' id="compile"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('compile');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">session缓存 (<span>清除后可能会注销登陆</span>)</td>
		<td align='center'><font color='green'>{$session_cache} MB</font></td>
		<td align='center' id="session"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('session');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">静态缓存</td>
		<td align='center'><a id="c_html" onclick="checkcache('html');" style="cursor:pointer">点击获取</a></td>
		<td align='center' id="html"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('html');">清除缓存</button></div></td>
	</tr>

	<tr class="tdbg">
		<td style="padding-left:20px">搜索引擎蜘蛛爬行记录 (<span>搜索引擎蜘蛛爬行的记录文件大小</span>)</td>
		<td align='center'><font color='green'>{$robot_cache} MB</font></td>
		<td align='center' id="robotlog"><div class="aui_buttons"  style="text-align:left;display: inline;"><button type="submit" class="aui_state_highlight" onClick="delcache('robotlog');">清除缓存</button></div></td>
	</tr>

  </table>
<script type="text/javascript">
function delcache(dir){
	$('#'+dir).html("<img src='static/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "{'Admin/Cache/del'|url}",
	   dataType: "json",
	   data: "action=del&file="+dir,
	   success: function(a){
		   if(a.status==1){
				$('#'+dir).html("<font color='green'>清除成功</font>");
		   }else{
				$('#'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
function checkcache(dir){
	$('#c_'+dir).html("<img src='static/images/load_blue.gif'>");
	$.ajax({
	   type: "POST",
	   url: "{'Admin/Cache/del'|url}",
	   dataType: "json",
	   data: "action=checksize&file="+dir,
	   success: function(a){
		   if(a.status==1){
				$('#c_'+dir).html("<font color='green'>"+a.size+"</font>");
		   }else{
				$('#c_'+dir).html("<font color='red'>"+a.info+"</font>");
		   }
	   }
	});
}
</script>
<div class="runtime"></div>  
</div>
</body>
</html>